<?php
namespace app\admin\validate;

use think\Validate;

class ThumbValidate extends Validate
{
    protected $rule = [
        "id" => 'require',
        "sort"=>'require|number',
        "thumb"=>'require',
        "link_url"=>'require',
        "status" => 'require|in:1,-1',
    ];

    protected $message = [
        "id.require" => "缺少id",
        "sort.require"=>"排序必须填写",
        "sort.number"=>"排序必须是数字",
        "thumb.require"=>"缩略图必须上传",
        "link_url.require"=>"链接地址必须上传",
    ];

    protected $scene = [
        'add' => ['thumb','sort',"link_url"],
        'edit' => ['id','thumb','sort',"link_url"],
        'status'=>['id','status'],
    ];

}